package task.job;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.Instant;

@Component
public class MultiJob {
//    @Scheduled(cron = "00,02,04 * * * * ?")
//    public void syncTask1() throws InterruptedException {
//        System.out.println(Instant.now());
//        Thread.sleep(3000);
//        System.out.println("sync task 1");
//    }
//
//    @Scheduled(cron = "00,02,04 * * * * ?")
//    public void syncTask2() throws InterruptedException {
//        System.out.println(Instant.now());
//        Thread.sleep(3000);
//        System.out.println("sync task 2");
//    }

    @Scheduled(cron = "0/4 * * * * ?")
    public void syncTask2(String name) {
        System.out.println(Instant.now());
        System.out.println(name);
    }
}
